# $FreeBSD$

PORTNAME=pfSense-pkg-netify
PORTVERSION=1.0.5
PORTREVISION=1
CATEGORIES=security
MASTER_SITES=
MAINTAINER=team@netify.ai
COMMENT=pfSense package netify
LICENSE=GPLv3+
LICENSE_FILE=${WRKSRC}/../../../../LICENSE
DISTFILES=
EXTRACT_ONLY=

#RUN_DEPENDS=netifyd>=2.97:security/netifyd

NO_BUILD=yes
NO_MTREE=yes
SUB_FILES=pkg-install pkg-deinstall
SUB_LIST=PORTNAME=${PORTNAME}

do-extract:
	${MKDIR} ${WRKSRC}

do-install:
	${MKDIR} ${STAGEDIR}${DATADIR}
	${MKDIR} ${STAGEDIR}${DOCSDIR}
	${MKDIR} ${STAGEDIR}${PREFIX}/pkg
	${MKDIR} ${STAGEDIR}${PREFIX}/pkg/netify
	${MKDIR} ${STAGEDIR}${PREFIX}/pkg/shortcuts
	${MKDIR} ${STAGEDIR}${PREFIX}/www/netify
	${MKDIR} ${STAGEDIR}${PREFIX}/www/netify/images
	${MKDIR} ${STAGEDIR}/etc/inc/priv

	${INSTALL_DATA} -m 0644 ${FILESDIR}/INSTALL-pfSense-2.4.4-p3.md \
		${STAGEDIR}${DOCSDIR}
	${INSTALL_DATA} ${FILESDIR}${DATADIR}/info.xml \
		${STAGEDIR}${DATADIR}
	${INSTALL_DATA} -m 0644 ${FILESDIR}${PREFIX}/pkg/netify.xml \
		${STAGEDIR}${PREFIX}/pkg
	${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/netify/netify.inc \
		${STAGEDIR}${PREFIX}/pkg/netify
	${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/netify/netify_defs.inc \
		${STAGEDIR}${PREFIX}/pkg/netify
	${INSTALL_DATA} -m 0644 ${FILESDIR}${PREFIX}/pkg/shortcuts/netify.inc \
		${STAGEDIR}${PREFIX}/pkg/shortcuts
	${INSTALL_DATA} ${FILESDIR}${PREFIX}/www/netify/netify_status.php \
		${STAGEDIR}${PREFIX}/www/netify
	${INSTALL_DATA} ${FILESDIR}${PREFIX}/www/netify/netify_provision.php \
		${STAGEDIR}${PREFIX}/www/netify
	${INSTALL_DATA} ${FILESDIR}${PREFIX}/www/netify/images/netify.svg \
		${STAGEDIR}${PREFIX}/www/netify/images

	@${REINPLACE_CMD} -i '' -e "s|%%PKGVERSION%%|${PKGVERSION}|" \
		${STAGEDIR}${DATADIR}/info.xml \
		${STAGEDIR}${PREFIX}/pkg/netify.xml

.include <bsd.port.mk>
